package com.facebook.imagepipeline.animated.impl;

import android.os.SystemClock;

class RollingStat
{
  private static final int WINDOWS = 60;
  private final short[] mStat = new short[60];

  int getSum(int paramInt)
  {
    long l = SystemClock.uptimeMillis() / 1000L;
    int i = (int)((l - paramInt) % 60L);
    int j = (int)(0xFF & l / 60L);
    int k = 0;
    for (int m = 0; m < paramInt; m++)
    {
      int n = this.mStat[((i + m) % 60)];
      int i1 = n & 0xFF;
      if ((0xFF & n >> 8) == j)
        k += i1;
    }
    return k;
  }

  void incrementStats(int paramInt)
  {
    long l = SystemClock.uptimeMillis() / 1000L;
    int i = (int)(l % 60L);
    int j = (int)(0xFF & l / 60L);
    int k = this.mStat[i];
    int m = k & 0xFF;
    if (j != (0xFF & k >> 8));
    for (int n = paramInt; ; n = m + paramInt)
    {
      int i1 = n | j << 8;
      this.mStat[i] = ((short)i1);
      return;
    }
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.facebook.imagepipeline.animated.impl.RollingStat
 * JD-Core Version:    0.6.2
 */